import request from '@/router/axios';

// /* 商户信息 详情 */
// export const getInfoDetail = (rpiNo) => {
//   return request({
//     url: '/api/rb-oem/oem/posinfo/pos_info/detailTwo',
//     method: 'get',
//     params: {
//       rpiNo
//     }
//   })
// }

/* 微信appid 查看 */
export const queryWxConfig = (params) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/queryWxConfig',
    method: 'get',
    params
  })
}
/* 微信appid 设置 */
export const alterAppid = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/alterAppid',
    method: 'post',
    data: row
  })
}
/* 微信appid 设置 */
export const alterJsAPIPath = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/alterJsAPIPath',
    method: 'post',
    data: row
  })
}

/* 商户信息 详情 */
export const getInfoDetail = (rpiNo) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/basicDetail',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 集团商户信息 详情 */
export const getGroupDetail = (rpiNo) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/groupDetail',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 商户资质证件图片 详情 */
export const getInfoPicDetail = (incomingCode) => {
  return request({
    url: '/api/rb-oem/oem/posinfo/pos_info/picDetail',
    method: 'get',
    params: {
      incomingCode
    }
  })
}

/* 商户资质证件图片 v2.0.0 详情 */
export const getPicDetail = (rpiNo) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/basicPicDetail',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 商户资质证件图片修改 详情 */
export const getPicUpdateDetail = (incomingCode) => {
  return request({
    url: '/api/rb-oem/oem/posinfo/pos_info/picUpdateDetail',
    method: 'get',
    params: {
      incomingCode
    }
  })
}

/* 通道列表 v2.0.0 */
export const queryBasicAisleList = (rpiNo) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/queryBasicAisleList',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 通道列表 v2.0.0 plus */
export const queryBasicAisleListPlus = (rpiNo) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/queryBasicAisleListPlus',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 通道列表 v2.0.0 plusById */
export const queryBasicAisleListPlusById = (id) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/queryBasicAisleListPlusById',
    method: 'get',
    params: {
      id
    }
  })
}

/* 实名认证 rpiNo aisleCode custType(1微信 2支付宝) */
export const queryReal = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/queryReal',
    method: 'post',
    data: row
  })
}

/* 实名认证 交行开户进度 */
export const applyStateQry = (operateType, rpiNo) => {
  return request({
    url: '/api/rb-oem/oem/jtIncoming/jtIncoming/applyStateQry',
    method: 'post',
    params: {
      operateType,
      rpiNo
    }
  })
}

/* 实名认证 开通商户 */
export const incomingFlow = (rpiNo, aisleCode) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/incomingFlow',
    method: 'post',
    params: {
      rpiNo,
      aisleCode
    }
  })
}

/* 实名认证 设置单通道费率 */
export const singleChannel = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/singleChannel',
    method: 'post',
    data: row,
  })
}

/* 基本信息修改 */
export const basicInformationUpdate = (row) => {
  return request({
    url: '/api/rb-oem/oem/posinfo/pos_info/basicInformationUpdate',
    method: 'post',
    data: row
  })
}

/* 图片信息修改 */
export const updateAllPic = (row) => {
  return request({
    url: '/api/rb-oem/oem/posinfo/pos_info/updateAllPic',
    method: 'post',
    data: row
  })
}

/* 图片信息修改 v2.0.0 */
export const updatePicAll = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/updatePicAll',
    method: 'post',
    data: row
  })
}

/* 开通或关闭d0 */
export const postOptOnlineDO = (row) => {
  return request({
    url: '/api/rb-oem/oem/posinfo/pos_info/optOnlineD0',
    method: 'post',
    data: row
  })
}

/* 微信认证通道列表 */
export const queryAisleList = (rpiNo) => {
  return request({
    url: '/api/rb-oem/oem/posinfo/pos_info/queryAisleList',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 微信认证通道详情 */
export const yinshengDetail = (rpiNo) => {
  return request({
    url: '/api/rb-oem/oem/posinfo/pos_info/yinshengDetail',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 撤销申请 wechat */
export const getRevoke = (applyNo, aisleCode) => {
  return request({
    url: '/api/rb-oem/oem/posinfo/pos_info/cancelApplyWxAuthor',
    method: 'post',
    params: {
      applyNo,
      aisleCode
    }
  })
}

/* 撤销申请 alipay */
export const getCancelAuthMessages = (applyNo, aisleCode) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/cancelAuthMessages',
    method: 'post',
    params: {
      applyNo,
      aisleCode
    }
  })
}

/* 重新发短信 */
export const resendMsg = (row) => {
  return request({
    url: '/api/rb-oem/oem/posinfo/pos_info/resendMsg',
    method: 'post',
    data: row
  })
}

/* 查询微信实名认证数据 */
export const queryWXApplyData = (rpiNo) => {
  return request({
    url: '/api/rb-oem/oem/posinfo/pos_info/queryWXApplyData',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 修改微信签约信息 */
export const updateWXApplyData = (row) => {
  return request({
    url: '/api/rb-oem/oem/posinfo/pos_info/updateWXApplyData',
    method: 'post',
    data: row
  })
}

/* 变更服务商 详情 */
export const getServiceChangeDetail = (rpiNo) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/serviceChangeDetail',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 变更服务商 提交 */
export const serviceChange = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/serviceChange',
    method: 'post',
    data: row
  })
}

/* 变更集团商户 提交 */
export const groupChange = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/groupChange',
    method: 'post',
    data: row
  })
}

/* 定位ip权限修改 */
export const ipLimitChange = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/ipLimitChange',
    method: 'post',
    data: row
  })
}

/* 商户签约费率*/
export const queryAisleRate = (aisleCode, rpiNo) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/queryAisleRate',
    method: 'get',
    params: {
      aisleCode,
      rpiNo
    }
  })
}

/* 通道配置 详情 */
export const getQueryAisleDetailByRpi = (rpiNo) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/queryAisleDetailByRpi',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 通道支付公司配置 详情 */
export const queryCompDetailByRpi = (params) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/queryCompDetailByRpi',
    method: 'get',
    params: {
      ...params
    }
  })
}

/* 通道配置 状态控制 0否1是 rpiNo, aisleCode, payKind, isOn */
export const onOrOffPayCompany = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/onOrOffPayCompany',
    method: 'post',
    data: row
  })
}

/* 通道支付公司配置 状态控制 0否1是 rpiNo, aisleCode, compNo, skillType, isOn */
export const onOrOffPayCompanySkill = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/onOrOffPayCompanySkill',
    method: 'post',
    data: row
  })
}

/* 通道配置 变更默认通道 */
export const changeDefaultAisle = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/changeDefaultAisle',
    method: 'post',
    data: row
  })
}

/* 通道配置 变更过支付能力默认通道 */
export const changeDefaultSkillAisle = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/changeDefaultSkillAisle',
    method: 'post',
    data: row
  })
}

/* 录入商户(merchantType:2) 更新渠道商户编号 */
export const updateMercId = (row) => {
  return request({
    url: '/api/rb-oem/oem/incomingbasic/incoming_basic/updateMercId',
    method: 'post',
    data: row
  })
}


/* 合同签约验证码提交易生 */
export const apiysSingn = (row) => {
  return request({
    url: '/api/rb-merchant/easyPay/mer/contract',
    method: 'post',
    data: row
  })
}

/* 易生中原 */
export const apizySingn = (row) => {
  return request({
    url: '/api/rb-merchant/easyZyPay/mer/contract',
    method: 'post',
    data: row
  })
}